<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jq/jquery-3.3.1.min.js"></script>
    <script>
        $(function () {
            $('li').eq(-1).prev().css('background', 'blue')
        })
    </script>
</head>
<body>
<ul>
    <li>python</li>
    <li>python</li>
    <li>python</li>
    <li>python</li>
    <li>python</li>
    <li>python</li>
    <li>python</li>
    <li>python</li>
</ul>
</body>
</html>